package practice3;

import org.junit.Test;
import static org.junit.Assert.*;

public class ExerciseV2Test {
    @Test
    public void testGenerateAdditions() {
        ExerciseV2 exer = new ExerciseV2(50);
        exer.generateAdditions(100);
        assertEquals(50, exer.getArithmetics().size());
        for (AbstractArithmetic a : exer.getArithmetics()) {
            assertTrue(a instanceof Addition);
            assertTrue(a.getNum1() + a.getNum2() <= 100);
        }
    }

    @Test
    public void testGenerateSubtractions() {
        ExerciseV2 exer = new ExerciseV2(50);
        exer.generateSubtractions(100);
        assertEquals(50, exer.getArithmetics().size());
        for (AbstractArithmetic a : exer.getArithmetics()) {
            assertTrue(a instanceof Subtraction);
            assertTrue(a.getNum1() - a.getNum2() >= 0);
        }
    }
}